Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PL-32: Demo Functional tests using Behat. #16

Merged
merged 11 commits into from
Feb 6, 2020
Merged

Conversation

damontgomery
Copy link
Contributor

@damontgomery damontgomery commented Jan 9, 2019

JIRA Ticket(s)

Description

Adds a Functional testing framework (Behat) and a few simple tests to the demo.

Because the content is required, I felt like a good place to start here was to get Behat tests up for the demo repo. We are using Behat on other projects, but not with Javascript support.

I created a PR against the-vagrant for Chromedriver support, palantirnet/the-vagrant#62. This has that same role.

This includes a Phing task to start selenium, phing start-selenium.

I could not get the Ansible part to start selenium, but maybe other people will have ideas there.

Testing instructions

vagrant reload --provision
vagrant ssh
phing build install-all (if you haven't already)
phing start-selenium
vendor/bin/behat --tags=javascript

Relevant Screenshots/gifs:

example


Pull Request Guidelines

These can be run from the base of the repo from inside the vm: `vendor/bin/behat --tags=javascript`

Behat is configured to test the D8 site by default.

The wait script was necessary since sometimes the react app wasn't loaded before the system would try to find the text.

The D7 content is random, but `ex` seems to frequently be a string we can search for.
To test

```
vagrant reload --provision
vagrant ssh
phing start-selenium
vendor/bin/behat --tags=javascript
```
The before step is needed so that the filters are visible and can be selected.
@damontgomery
Copy link
Contributor Author

I added tests that use the filters on the d8 site. There are some supporting step definitions as well.

@agentrickard
Copy link
Contributor

This work looks like it needs an update:

@javascript
Feature: Drupal 8 search
  As a site visitor
  I want to search the Drupal 8 sites
  So that I can read recipes

  Scenario: Search for "pasta"                                     # features/drupal-8-search.feature:7
    ┌─ @BeforeStep # FeatureContext::beforeStep()
    │
    ╳  Could not open connection: session not created: Chrome version must be between 70 and 73
    ╳    (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.4.0-164-generic x86_64) (WARNING: The server did not provide any stacktrace information)
    ╳  Command duration or timeout: 117 milliseconds
    ╳  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    ╳  System info: host: 'federated-search-demo', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-164-generic', java.version: '1.8.0_222'
    ╳  Driver info: driver.version: unknown (Behat\Mink\Exception\DriverException)
    │

This branch should also merge in the latest build changes.

@agentrickard
Copy link
Contributor

Updated the sources and still getting errors:

    ┌─ @BeforeStep # FeatureContext::beforeStep()
    │
    ╳  Could not open connection: Timed out waiting for driver server to start.
    ╳  Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
    ╳  System info: host: 'federated-search-demo', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-164-generic', java.version: '1.8.0_222'
    ╳  Driver info: driver.version: unknown (Behat\Mink\Exception\DriverException)
    │

@agentrickard agentrickard changed the base branch from master to solr-4 February 6, 2020 15:25
@agentrickard agentrickard merged commit 0c82dd8 into solr-4 Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants